/**
 * Created by jiangqifan on 16/2/29.
 */
var mongoose  = require('mongoose');
var BaseModel = require("./base_model");
var Schema    = mongoose.Schema;
//var _ = require('lodash');

var ProjectSchema = new Schema({
    name: { type: String, required:true},
    title:{type: String},
    description:{type: String},
    certs:{type:[Schema.Types.ObjectId]},
    //certs:{type:[{}]},
    dependencies:{type:[{}]},
    creator:{type: String},
    namespace:{type:String},
    create_at: { type: Date, default: Date.now },
    update_at: { type: Date, default: Date.now }
});

ProjectSchema.plugin(BaseModel);


//ProjectSchema.index({name: 1}, {unique: true});

module.exports = mongoose.model('Project', ProjectSchema);
